<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>{$title}</title>
<include file='web/common:source'/>
<style>
div.layui-layer-shade{background-color:rgba(255,255,255,0) !important;}
div.layui-layer-rim{border:none; box-shadow:3px 5px 6px #dadada,-3px -1px 6px #dadada;}
div.layui-layer-title{background-color:#e2e5e8;}
</style>
<script type="text/javascript" src="__ROOT__/static/web/js/esign.js"></script>
</head>
<body ng-app="myApp" ng-controller="myAppControl">
<div class="mainBox m o">
    <div class="mainRight fr" style="padding-bottom:0px;">
        <include file='web/common:header'/>
        <div class="mainRightBot pr o">
            <!-- leftMenu start -->
            <include file='web/common:left'/>
            <!-- leftMenu end -->
            <div class="rightBox fr" style="width:940px; min-height:900px; background: #f1f1f1;">
                <div class="personBox m"> 
					<dl class="personBox jifenDetails personCenter m pr">
						<dt>个人中心</dt>
						<dt class="palt" style="top:80px; left:75px; background:none;">我的总积分(分)： <span>{$data['points']['balance']}</span></dt>
                        <dd class="palt history" style="padding:0px; top:120px; left:110px;">冻结积分(分)：<span style="color:red;">{$data['points']['freeze']}</span> </dd>
                        <dd class="palt history" style="padding:0px; top:143px; left:110px;">历史总积分(分)：{$data['points']['total']}</dd>
                        <dd class="xize palt" style="padding:0px; top:165px; left:110px;"><a href="{:U('user/pointsList',array('type'=>1))}" class="ts300">查看积分细则<i class="layui-icon" style="font-size: 16px;">&#xe602;</i></a></dd>
						<dd class="o">
							<div class="ddLeft o fl" style="width:82px;">
								<if condition="$commonParam['user']['avatar'] eq ''">
									<div class="faceBox o fl pr z10" style="text-align:center; line-height: 82px; font-size:18px; color:#fff; background:#3296fa;">
									{$commonParam['user']['name']}
								<else/>
									<div class="faceBox o fl pr z10">
									<img src="{$commonParam['user']['avatar']}" class="ts300 pr " alt="">
								</if>
								</div>
							</div>
						</dd>	
						<dd class="ddRight part"><a href="">积分提现申请</a></dd>
                        <dd class="ddRightTextTip part" style="padding-top:0px; top:110px;">请在每月10号以前申请</dd>					
					</dl>
					<dl class="personBox personInfo">
						<dt class='o'>
							<!-- <a href="" class="fr ts300">修改资料</a> -->
							<span class="fl">个人信息</span>
						</dt>
						<dd class="o">
							<ul class="o">
								<li><span>姓名：</span>{$data['user']['name']}</li>
								<li><span>我的组织：</span>{$data['user']['department']}</li>
								<li><span>我的职位：</span><if condition="$data['user']['position'] eq ''">暂无职位<else/>{$data['user']['position']}</if></li>
								<li><span>邮箱：</span><if condition="$data['user']['email'] eq ''">暂无邮箱<else/>{$data['user']['email']}</if></li>
								<li><span>联系电话：</span>{$data['user']['mobile']}</li>
							</ul>
						</dd>
					</dl> 
					<dl class="personBox personSave">
						<dt>账号安全</dt>
						<div class="o">
							<dd class="o fl" style="width:220px;">
								<div class="ddLeft o fl">
									<div class="faceBox o fl pr z10"><img src="__ROOT__/static/web/images/img28.png" class="ts300 pr " alt=""></div>
									<a href="javascript:;" ng-click="editPassword()" class="b fl ts300">修改密码&nbsp;<i class="layui-icon" >&#xe602;</i> </a>
								</div> 
							</dd>
							<dd class="fl pr" style="width:240px; padding:25px 0px;">
								<div class="ddLeft o fl">
									<div class="faceBox o fl pr z10"><img src="__ROOT__/static/web/images/img70.png" class="ts300 pr " alt=""></div>
									<a href="javascript:;" ng-click="setSign()" class="b fl ts300">设置用户签名&nbsp;<i class="layui-icon" >&#xe602;</i> </a>
								</div>
								<if condition="$data['user']['signature'] neq ''">
									<img class="part" style="top:20px; right:-170px; border:1px solid #eee;" src="{$data['user']['signature']}" width="120" height="60" alt="">
								<else/>
									<img class="part dn" style="top:20px; right:-170px; border:1px solid #eee;" src="" class="" width="120" height="60" alt="">
								</if>
							</dd>
						</div>
					</dl>
					<style type="text/css">
					dl.thrOracle dd{width:660px;}
					dl.thrOracle dd a{display: block; width:110px; height:110px; border:1px solid #3296FA; border-radius:50%; text-align: center; line-height: 110px; color:#3296FA; font-size:17px;}
					#canvasEdit{border-bottom:1px solid #e2e5e8; margin:0px auto;}
					div.signBtn{width:480px; margin:0px auto; padding-top:20px;}
					div#signShow{padding-top:20px; text-align: center;}
					div.signBtn a{display:block; width:175px; height:35px; text-align: center; line-height: 35px; background:#3296fa; color:#fff; font-size:16px; border-radius:5px; }
					</style>
					<div class="signBox" style="display: none;">
						<canvas width="650px" height="280" id="canvasEdit"></canvas>						
						<div id="signShow" style="display: none;"></div>
						<div class="signBtn o">
							<a href="javascript:;" class="fl" id="signClear">清&nbsp;&nbsp;&nbsp;&nbsp;除</a>
							<a href="javascript:;" class="fr" id="signOk">确&nbsp;&nbsp;&nbsp;&nbsp;认</a>
						</div>						
					</div>
					<dl class="personBox personSave thrOracle" style="padding:40px 0px 60px; border-top:2px solid #E5E5E5;">
						<dd class="o pr m" style="padding:0px;">
							<a href="{:U('user/pointsList',array('type'=>0))}" class="fl">领取积分</a>
							<a href="javascript:;" class="m"><span style="display:inline-block; line-height:20px;">&nbsp;<br>&nbsp;<br>积分申请<br>查看</span></a>
							<a href="{:U('user/pointsList',array('type'=>1))}" class="part">积分明细</a> 
						</dd>
					</dl>
                </div>            
                <!-- 新建订单 弹出层 start -->
                <include file='web/common:createDingdan'/>
                <!-- 新建订单 弹出层 end -->
                <!-- 新建项目 弹出层 新建项目 start -->
                <include file='web/common:createProject'/>
                <!-- 新建项目 弹出层 end -->
                <!-- 新建合同 弹出层 start -->
                <include file='web/common:createHetong'/>
                <!-- 新建合同 弹出层 end -->
            </div>
        </div>
    </div>
</div>
</body>
<include file='web/common:footer'/>
<script type="text/javascript">
// angular start
var locationUrl = "{:U('Project/index')}";
var hostUrl = "http://"+"<?php echo $_SERVER['HTTP_HOST']; ?>/";
var setSignatureUrl = hostUrl + "user/setSignature";
var setPasswordUrl = hostUrl + "user/setPassword";
angular.module("myApp",[]).controller('myAppControl',['$scope',function($scope){
    $scope.setSign = function(){
		layer.open({
			type: 1,
			scrollbar:false,
			title: ['设置用户签名', 'font-size:18px;'],
			skin: 'layui-layer-rim',
			area: ['650px', '480px'],
			content: $(".signBox")
		});
    };
    $scope.editPassword = function(){ 
		layer.prompt({
			formType: 1,
			value: null,
			title: '密码格式：4到16位(字母/数字/下划线/减号)',
		},function(val,index){
			var indexs = index;
			$.post(setPasswordUrl,{password:val},function(res){
				if(res.message == "OK"){
					layer.confirm('修改成功',{
						btn:['确定','重新修改']
					},function(index){
						layer.close(index);
						layer.close(indexs);
					});
				}else{
					layer.alert(res.message);
				};
			},'json');
		});
    };
}]);
$().esign("canvasEdit", "signShow", "signClear", "signOk",function(){
	var getImgPath = $("#signShow").find('img').attr('src');
	$.post(setSignatureUrl,{data:getImgPath},function(res){
		if(res.message == "OK"){
			layer.confirm('设置成功', {
				btn: ['确定','重新设置']
			}, function(){
				location.reload();
			});			
		}else{
			layer.alert(res.message);
		};
	},'json');
}); 
</script>
</html>